﻿using System.Threading.Tasks;
using Abp.Application.Services;
using Abp.Application.Services.Dto;
using Abp.Authorization;
using Abp.Domain.Entities;
using Abp.Domain.Repositories;
using KelonProud.Extensions;

namespace KelonProud.Mvc
{
    [AbpAuthorize]
    public abstract class KelonProudAsyncCrudAppService<TEntity, TEntityDto, TPrimaryKey, TGetAllInput, TCreateInput, TUpdateInput>: AsyncCrudAppService<TEntity, TEntityDto, TPrimaryKey, TGetAllInput, TCreateInput, TUpdateInput>
        where TEntity : class, IEntity<TPrimaryKey>
        where TEntityDto : IEntityDto<TPrimaryKey>
        where TUpdateInput : IEntityDto<TPrimaryKey>
    {
        protected KelonProudAsyncCrudAppService(IRepository<TEntity, TPrimaryKey> repository) : base(repository)
        {
        }

        public abstract Task<TEntityDto> Save(TCreateInput input);

        public new IAbpSessionExtension AbpSession { get; set; }
    }
    
}
